<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset='utf8'>
</head>
<body>
   
</body>
<script>
     var list = [99,8,'z','Z','A',6,2,'静静','贱贱','熙熙','哈哈','舒舒','艳艳','波波'];

     console.log(list.length);
     //不会改变原数组的方法
     console.log(list);
     //合并新数组
     console.log("concat: ",list.concat(9));
     console.log("concat: ",list.concat([true,false,666]));
     console.log("concat: ",list.concat(true,false,666));
     console.log("concat: ",list.concat([[1,2,3],[6,7,8]]));
     //将数组连接为字符串
     console.log('join: ',list.join());
     console.log("join: ",list.join("---"));
     //截取数组一部分
     console.log("slice: ",list.slice(2,4));


     console.log(list);

     //会改变数组的方法
     console.log('===============================');

     console.log(list);
     //数组最后追加元素
     console.log("push: ",list.push(666));
     console.log(list);
     //pop删除数组最后一个位置
     console.log("pop: ",list.pop());

     console.log(list);

     //unshift想数组首个位置追加元素
     console.log("unshift: ",list.unshift(999));
     console.log(list);

     //shift删除数组首个位置元素
     console.log('shift:' ,list.shift());
     console.log(list);

     //翻转数组
     console.log("reverse: ",list.reverse());
     console.log(list);

     //sort ASCII
     console.log('sort: ',list.sort());
     

     console.log(list);
</script>
</html>